package com.gientech.customercenter.controller;

import com.gientech.customercenter.entity.Customer;
import com.gientech.customercenter.service.CustomerService;
import com.gientech.loancommon.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class CustomerController {

    @Autowired
    private CustomerService customerService;

    /**
     * 客户注册
     * @param customer
     * @return
     */
    @PostMapping("/customerRegister")
    public ResponseResult customerRegister(@RequestBody Customer customer){
        return customerService.customerRegister(customer);
    }

    /**
     * 根据id查询客户信息
     * @param customerId
     * @return
     */
    @GetMapping("/getById")
    public ResponseResult getById(@RequestParam Long customerId){
        return new ResponseResult(customerService.getById(customerId));
    }
}
